<template>
  <div>
    我是
    {{textOne}}头
    <button @click="show">从js父中获取组件的值</button>
  </div>
</template>

<script>
export default {
  data () {
    return {

    }
  },
  components: {

  },
  methods: {
    show () {
      alert(this.textOne);
    }
  },
  // 接收父组件值参数的设置
  props: ['textOne']
}
</script>

<style scoped>
div {
  height: 100px;
  background-color: yellowgreen;
}
</style>
